<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>行内元素垂直居中</title>
    <style>
        .parent1 {
            height: 200px;
            background-color: cyan;
            /* line-height:等于父元素高度; 设置行内元素垂直居中
                注意: 这种方式只适合单行文本垂直居中处理. 
             */
            line-height: 200px;
        }
    </style>
</head>

<body>

    <div class="parent1">
        <div class="child1"> child</div>
    </div>
</body>

</html>